CREATE TABLE [dbo].[TTCNTA_DOCU]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[CO_CNTA_EMPR] [dbo].[TD_VC_020_CNTA] NOT NULL,
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL,
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST_] NOT NULL,
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL,
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST_] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTCNTA_DOCU] ADD CONSTRAINT [CK__TTCNTA_DO__CO_CN__1F2E9E6D] CHECK (([CO_CNTA_EMPR]>='0' AND [CO_CNTA_EMPR]<='99999999999999999999'))
GO
ALTER TABLE [dbo].[TTCNTA_DOCU] ADD CONSTRAINT [XPKTTCNTA_DOCU] PRIMARY KEY CLUSTERED  ([CO_EMPR], [CO_CNTA_EMPR]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTCNTA_DOCU] ADD CONSTRAINT [TMPLAN_ANNO_A_TTCNTA_DOCU] FOREIGN KEY ([CO_EMPR], [CO_CNTA_EMPR]) REFERENCES [dbo].[TMPLAN_ANNO] ([CO_EMPR], [CO_CNTA_EMPR])
GO
